home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Source / MiscGISKit / MiscIrelandUTMCoord.m < prev    next >
Text File  |  1995-07-20  |  3KB  |  85 lines

  1. /*========================== MiscIrelandUTMCoord.m ==========================*/
  2. /* MiscIrelandUTMCoord class contains and supports values representing
  3.    locations in an Irish Universal Transverse Mercator coordinate system
  4.    with airy values from post 1953 addendum.
  5.  
  6.    DMA Release 0.8, Copyright @1993 by Genesis Project, Ltd. All Rights
  7.    Reserved. For further information on terms and conditions see:
  8.         Documentation/GISKit/Agreements-Legal-README
  9.  
  10. HISTORY
  11. 21-Mar-93  Dale Amon at GPL
  12.        Created.
  13. */
  14.  
  15. #import <misckit/miscgiskit.h>
  16.  
  17. @implementation MiscIrelandUTMCoord
  18.  
  19. /*===========================================================================*/
  20. /* Internal methods */
  21. /*===========================================================================*/
  22.  
  23. static id theIrishGrid = nil;
  24.  
  25. + makeGrid
  26.   {
  27.    if (!theIrishGrid)
  28.     {theIrishGrid = [[MiscUTMConstants allocFromZone: [self zone]]
  29.                initGridName: "Irish Grid"
  30.              trueOrigin: 53.5 : -8.0
  31.                  inGrid: 200000.0    : 250000.0
  32.                onSphere: 6377563.396 : 6356256.910
  33.          centralMeridianScaling: 1.000035];
  34.      [theIrishGrid setProtected];
  35.     }
  36.     return theIrishGrid;
  37.   }
  38.  
  39.  
  40. /*===========================================================================*/
  41. /* Initialization methods. If we don't already have a UTM constants object
  42.    for the Irish Grid, create one instance that all will share and that
  43.    cannot be deleted.
  44.  
  45.    Values are from the Irish Ordinance Survey document, "Tables for the
  46.    Transverse Mercator Projection of Ireland", 1953, reprinted 1971, with
  47.    addendum for modified airy sphere.
  48.  
  49. */
  50. /*===========================================================================*/
  51. /* DESIGNATED INITIALIZER */
  52.  
  53. -initDescription: (char *) txt
  54.  {
  55.     
  56.     [super initDescription: txt constants: [MiscIrelandUTMCoord makeGrid]];
  57.  
  58.     /* over ride the standard converter */
  59.     converter = [MiscIrelandCoordConverter new];
  60.     return self;
  61.  }
  62.  
  63.  
  64. /*---------------------------------------------------------------------------*/
  65. /* Block the designated initializer of our parent class */
  66.  
  67. -initDescription: (char *) txt constants: anObject
  68.  {    [self error:"  %s class should not be sent '%s' messages\n",
  69.             [[self class] name], sel_getName(_cmd)];
  70.     return self;
  71.  }
  72.  
  73. /*===========================================================================*/
  74. /* Archive methods */
  75. /*===========================================================================*/
  76. - awake
  77. {    [super awake];
  78.     [constants setUnprotected];
  79.     [constants free];
  80.     [MiscIrelandUTMCoord makeGrid];
  81.     return self;
  82. }
  83.  
  84. @end
  85.